/**   
* @Title: Test.java 
* @Package absfactory.Calculator 
* @Description: TODO(用一句话描述该文件做什么) 
* @author yangdechao   
* @date 2017-7-21 上午10:10:35 
* @version V1.0   
*/
package absfactory.Calculator;

import java.util.Scanner;

/**
 * @author john
 *
 */
public class Test {
	 public static void main(String[] args) {
		 System.out.print("请输入第一个数:");
		 Scanner scn = new Scanner(System.in);
	     double num1 = scn.nextDouble();
	     
	     System.out.print("请输入操作方式(+,-,*,/):");
	     String opt = scn.next();
	     System.out.print("请输入第二个数:");
	     double num2 = scn.nextDouble();
	     Operation operation = OptionerFactory.createOptioner(opt);
	     operation.setNum1(num1);
	     operation.setNum2(num2);
	     System.out.println("结果为："+operation.getResult());
	}
}
